package my.concurrent;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author fengbo
 */
public class DefaultThreadFactory implements ThreadFactory {

    private static final AtomicInteger ID = new AtomicInteger();

    @Override
    public Thread newThread(Runnable r) {
        String name = "epoll-worker-" + ID.getAndIncrement();
        return new Thread(r, name);
    }
}
